from urllib.request import Request
from urllib.request import urlopen
import ssl
url = 'https://kyfw.12306.cn/otn/gonggao/help.html'
headers = {
    'user-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0'
}
#  封装request对象

request = Request(url, headers=headers)
#  发送请求
# 忽略证书
context = ssl._create_unverified_context()

response = urlopen(request, context=context)
print(response.read().decode())